const util = require('../../utils/util.js')
Page({
  data : {
    id : '',
    cargo : '',
    title:''
  },
  onLoad(option){
    var that = this;
    this.setData({
        title : option.title
    })
    wx.setNavigationBarTitle({
      title: "车型编号："+ that.data.title
    })
    wx.showLoading({
      title: '加载中',
      mask: true
    })
    wx.request({
      url: util.http + "cargos/"+ option.id,
      data:{},
      header: {
        'content-type': 'application/json'
      },
      success:function(res){
        that.setData({
          cargo : res.data
        })
      },
      complete: function (res) {
        wx.hideLoading();
        if (res == null || res.data == null) {
          console.error('网络请求失败');
        }
      }
    })
  }
})